import axios from 'axios';

axios.interceptors.request.use((config)=>{
  config.headers['Authorization']="Bearer "+sessionStorage.getItem('token');
  return config
})

axios.interceptors.response.use((config)=>{
  switch(config.status){
    case 200:
      return config.data;
    default:
      alert('network error');
  }
})

export default axios;